//
// Created by xili on 2024/8/5 20:07.
// Go big or go home.
//
#include <iostream>
#include <unordered_set>

using namespace std;

class Solution {
public:
    string greatestLetter(string s) {
        string ans;
        unordered_set<char> us(s.begin(), s.end());
        for (int i = 25; i >= 0; i--) {
            if (us.count(i + 'a') && us.count(i + 'A')) {
                return string(1, i + 'A');
            }
        }
        return "";
    }
};